<template>
  <div class="app-container">
    <Find @handleBlur="selectVal" :OriginalFilter="{ static: true }" :formList="formList1" @findClicked="findData" @Launchform="Launchform" />

    <el-card style="margin-top: 10px" shadow="always" :body-style="{ padding: '5px' }">
      <div>
        <div style="width: 100%">
          <h1 style="color: red">{{ $t(`Print.ReceivingDetails`) }}</h1>
          <qiTable
            @selectListShow="selectListShow"
            @inputChange="confirmChange"
            @selectValChange="selectValChange"
            @confirmChange="confirmChange"
            @currentRow="currentRowList"
            :tableHeader="tableHeader"
            :tableData="TableDateListMaterials.inDtos"
            :TableHeight="70"
          />
          <qiTable :tableHeader="tableHeader2" :tableData="tableHeaderList" :TableHeight="20" />
        </div>
        <div>
          <h1 style="color: #0000ff">{{ $t(`Print.IssueDetails`) }}</h1>
          <qiTable
            @selectListShow="selectListShow1"
            @currentRow="currentRowList1"
            @confirmChange="confirmChange"
            @inputChange="confirmChange"
            @selectValChange="selectValChange"
            :tableHeader="tableHeader1"
            :tableData="TableDateListMaterials.outDtos"
            :TableHeight="32"
          />
          <qiTable :tableHeader="tableHeader3" :tableData="tableHeaderList1" :TableHeight="20" />
        </div>
      </div>
      <el-dialog width="20%" v-model="dialogVisible" :title="$t(`Print.CommandSelection`)">
        <qiTable
          @currentRow1="currentRowList2"
          :tableHeader="tableHeader7"
          :tableData="tableHeader7TableDate"
          :TableHeight="22"
          :outTableHeight="150"
        />
      </el-dialog>
    </el-card>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import LoginWork from '@/utils/LoginWork'
import { JudgmentInstruction } from '@/api/WarehouseDepartment/FactoryStorage/InputInsoleReceivingIssuingMaterials'
import JMessage from '@/utils/JMessage'
export default defineComponent({
  name: 'UpperReceivingIssuingMaterialInput'
})
</script>
<script lang="ts" setup>
import { i18n, Jzhcn } from '@/i18n'
import { ref, onMounted, watch } from 'vue'
import {
  TreasuryDepartment,
  AddedAllIncomingMaterials,
  deleteAddList,
  MaterialsReceivedAndIssuedInquiries
} from '@/api/WarehouseDepartment/FactoryStorage/UpperReceivingIssuingMaterialInput'
import type {
  AddedAllIncomingMaterialsParms,
  MaterialsReceivedAndIssuedInquiriesInterface
} from '@/api/WarehouseDepartment/FactoryStorage/UpperReceivingIssuingMaterialInput'
import { lotNoQuery } from '@/api/WarehouseDepartment/FactoryStorage/InputInsoleReceivingIssuingMaterials'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus'
const formList1 = ref([
  {
    type: 'input',
    inputPlaceholder: '请输入指令',
    inputValue: ''
  },
  {
    type: 'input',
    inputLabel: '型体',
    inputValue: ''
  },
  {
    type: 'input',
    inputLabel: '颜色',
    inputValue: ''
  },
  {
    type: 'input',
    inputLabel: '交期',
    inputValue: ''
  },
  {
    type: 'input',
    inputLabel: '数量',
    inputValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '新增全部收料'
  },
  {
    type: 'button',
    checkboxLabel: '全部收料'
  },
  {
    type: 'button',
    checkboxLabel: '新增全部发料'
  },
  {
    type: 'button',
    checkboxLabel: '全部发料'
  },
  {
    type: 'button',
    checkboxLabel: '查询'
  },
  {
    type: 'button',
    checkboxLabel: '删除当前行数据'
  }
])

// 判断指令是否存在
const lotNoList = ref('')

const selectVal = (row: any) => {
  lotNoList.value = row
  JudgmentInstructionMethods()
}

const dialogVisible = ref(false)

const JudgmentInstructionMethods = async () => {
  if (lotNoList.value !== '') {
    const result = await JudgmentInstruction(lotNoList.value)
    if (result.code === 200) {
    } else {
      lotNoQueryMethods()
      dialogVisible.value = true
    }
  }
}

const tableHeader7 = ref([
  {
    label: '指令',
    prop: 'lotNo',
    width: '160'
  }
])

const tableHeader7TableDate = ref([])

const currentRowList2 = (row: any) => {
  formList1.value[0].inputValue = row.lotNo
  dialogVisible.value = false
}

const lotNoQueryMethods = async () => {
  const result = await lotNoQuery(lotNoList.value)
  tableHeader7TableDate.value = result.map((item: any) => {
    return { lotNo: item }
  })
}

const formatCurrentDate = (date?: Date) => {
  const year = date!.getFullYear()
  const month = (date!.getMonth() + 1).toString().padStart(2, '0') // 确保月份是两位数
  const day = date!.getDate().toString().padStart(2, '0') // 确保日期是两位数
  return `${year}-${month}-${day}`
}

onMounted(() => {
  TreasuryDepartmentMethods()
})

const selectListShow = (row?: any, visible?: boolean) => {
  if (visible === true) {
    if (row !== undefined) {
      row.deptNo = {
        selectValue: row.deptNo.selectValue,
        options: vendorFlagName.value
      }
    }
  } else {
    if (row.deptNmae === Object) {
      row.deptName.options = []
    }
  }
}

const selectListShow1 = (row?: any, visible?: boolean) => {
  if (visible === true) {
    if (row !== undefined) {
      row.deptNo = {
        selectValue: row.deptNo.selectValue,
        options: vendorFlagName.value
      }
    }
  } else {
    if (row.deptNmae === Object) {
      row.deptName.options = []
    }
  }
}

const currentDate = ref(new Date())

const findData = (count: any) => {
  if (count === '查询') {
    MaterialsReceivedAndIssuedInquiriesMethdos()
  }
  if (count === '删除当前行数据') {
    if (deleteAddListMethodsParms.value === '') {
      JMessage.warning('请选择需要删除的数据')
    } else {
      handleCloseMateriaLKlc5()
    }
  }
  if (count === '新增全部收料') {
    activeList.value = 1
    if (MaterialsReceivedAndIssuedInquiriesMethdosTableDateList.value === '') {
      JMessage.warning('请先输入指令查询在进行新增')
    } else {
      typeList.value = 1
      TreasuryDepartmentMethods()
      AddedAllIncomingMaterialsMehtodsPamrs.value.slipType = 'I'
      TableDateListMaterials.value.inDtos.push(AddedAllIncomingMaterialsMehtodsPamrs.value as any)
    }
  }

  if (count === '新增全部发料') {
    activeList.value = 1
    if (MaterialsReceivedAndIssuedInquiriesMethdosTableDateList.value === '') {
      JMessage.warning('请先输入指令查询在进行新增')
    } else {
      typeList.value = 2
      TreasuryDepartmentMethods()
      AddedAllIncomingMaterialsMehtodsPamrs.value.slipType = 'O'
      TableDateListMaterials.value.outDtos.push(AddedAllIncomingMaterialsMehtodsPamrs.value as any)
    }
  }

  if (count === '全部收料') {
    let active: boolean = false
    console.log(currentRowListOnet.value)
    if (currentRowListOnet.value === undefined) {
      JMessage.warning('请选择需要全部收料的行数据')
    } else {
      for (let i = 1; i <= 26; i++) {
        if (currentRowListOnet.value['qty' + i] !== null) {
          active = false
        }
      }
      if (active) {
        JMessage.warning('请选择新增的数据进行全部收料')
      } else {
        for (let i = 0; i <= 26; i++) {
          currentRowListOnet.value['qty' + i] = tableHeaderList.value[1]['num' + i]
        }
        confirmChange(currentRowListOnet.value)
      }
    }
  }
  if (count === '全部发料') {
    let active: boolean = false
    if (currentRowListOnet.value === undefined) {
      JMessage.warning('请选择需要全部收料的行数据')
    } else {
      for (let i = 1; i <= 26; i++) {
        if (currentRowListOnet.value['qty' + i] !== null) {
          active = false
        }
      }
      if (active) {
        JMessage.warning('请选择新增的数据进行全部收料')
      } else {
        for (let i = 0; i <= 26; i++) {
          currentRowListOnet.value['qty' + i] = tableHeaderList1.value[1]['num' + i]
        }
        confirmChange(currentRowListOnet.value)
      }
    }
  }
}

const activeList = ref()

const EvaluatesTheArrayReturnValue = (ArrayList: any) => {
  return ArrayList.map((item: any, index: any) => {
    return {
      value: item,
      label: item
    }
  })
}

const vendorFlagName = ref([])

const typeList = ref(-1)

const TreasuryDepartmentMethods = async () => {
  let NewArray = []
  const result = await TreasuryDepartment(typeList.value)
  NewArray = result.reduce((arr: any, item: any) => {
    if (item.deptNo && item.deptName) {
      // 只添加非空的 typeName 和 typeNo
      arr.push(item.deptNo + ' ' + item.deptName)
    }
    return arr
  }, [])
  vendorFlagName.value = EvaluatesTheArrayReturnValue(NewArray)
  if (AddedAllIncomingMaterialsMehtodsPamrs.value.deptNo === Object) {
    AddedAllIncomingMaterialsMehtodsPamrs.value.deptNo.options = vendorFlagName.value
  }
}

const confirmChange = async (row?: any) => {
  let list = row.deptNo.selectValue.split(' ')
  row.deptNo = list[0]
  row.deptName = list[1]
  row.lotNo = MaterialsReceivedAndIssuedInquiriesMethdosTableDateList.value

  for (let i = 1; i <= 26; i++) {
    if (typeof row['qty' + i] === 'string') {
      row['qty' + i] = Number(row['qty' + i])
    }
  }
  const result = await LoginWork.put<any, any>(`/pcFactorStockQuery/stitchIOUp`, row)
  if (result.code === 200) {
    MaterialsReceivedAndIssuedInquiriesMethdos()
    activeList.value = 0
    JMessage.success(result.message)
  } else {
    activeList.value = 0
    MaterialsReceivedAndIssuedInquiriesMethdos()
    JMessage.error(result.message)
  }
}

// 新增全部收料
const selectValChange = (row: any) => {
  if (activeList.value === 1) {
    for (let i = 1; i <= 26; i++) {
      if (row['qty' + i] !== '') {
        row['qty' + i] = Number(row['qty' + i])
      }
    }

    row.deptName = row.deptNo.selectValue.split(' ')[1]
    row.deptNo = row.deptNo.selectValue.split(' ')[0]
    AddedAllIncomingMaterialsMehtods()
  } else {
    confirmChange(currentRowListOnet.value)
  }
}

const slipDate = formatCurrentDate(currentDate.value)

const AddedAllIncomingMaterialsMehtodsPamrs = ref<AddedAllIncomingMaterialsParms>({
  lotNo: '',
  deptNo: { selectValue: '', options: [] },
  deptName: '',
  slipDate: slipDate,
  qty1: '',
  qty2: '',
  qty3: '',
  qty4: '',
  qty5: '',
  qty6: '',
  qty7: '',
  qty8: '',
  qty9: '',
  qty10: '',
  qty11: '',
  qty12: '',
  qty13: '',
  qty14: '',
  qty15: '',
  qty16: '',
  qty17: '',
  qty18: '',
  qty19: '',
  qty20: '',
  qty21: '',
  qty22: '',
  qty23: '',
  qty24: '',
  qty25: '',
  qty26: '',
  remark: '',
  sendNo: '',
  slipNo: '',
  slipType: '',
  change: true,
  disableConfirm: true
})

const AddedAllIncomingMaterialsMehtods = async () => {
  const result = await AddedAllIncomingMaterials(AddedAllIncomingMaterialsMehtodsPamrs.value, TableDateListMaterials.value.size.length)
  if (result.code === 200) {
    MaterialsReceivedAndIssuedInquiriesMethdos()
    JMessage.success(result.message)
  } else {
    MaterialsReceivedAndIssuedInquiriesMethdos()
    JMessage.error(result.message)
  }
}

// 删除当前行数据

const currentRowListOnet = ref()

const currentRowList = (row: any) => {
  const { slipNo } = row
  deleteAddListMethodsParms.value = slipNo
  currentRowListOnet.value = row
  console.log(currentRowListOnet.value)
  typeList.value = 1
  TreasuryDepartmentMethods()
}

const currentRowList1 = (row: any) => {
  const { slipNo } = row
  deleteAddListMethodsParms.value = slipNo
  currentRowListOnet.value = row
  typeList.value = 2
  TreasuryDepartmentMethods()
}

const handleCloseMateriaLKlc5 = (_done?: () => void) => {
  ElMessageBox.confirm('确认要删除数据吗?')
    .then(async () => {
      deleteAddListMethods()
    })
    .catch(() => {})
}

const deleteAddListMethodsParms = ref('')

const deleteAddListMethods = async () => {
  const result = await deleteAddList(deleteAddListMethodsParms.value)
  if (result.code === 200) {
    deleteAddListMethodsParms.value = ''
    MaterialsReceivedAndIssuedInquiriesMethdos()
    JMessage.success(result.message)
  } else {
    deleteAddListMethodsParms.value = ''
    MaterialsReceivedAndIssuedInquiriesMethdos()
    JMessage.error(result.message)
  }
}

const Launchform = (row: any) => {
  MaterialsReceivedAndIssuedInquiriesMethdosTableDateList.value = row[0].inputValue
  AddedAllIncomingMaterialsMehtodsPamrs.value.lotNo = row[0].inputValue
}

const tableHeaderList = ref<any>([
  {
    label: '收料合计',
    num1: '',
    num2: '',
    num3: '',
    num4: '',
    num5: '',
    num6: '',
    num7: '',
    num8: '',
    num9: '',
    num10: '',
    num11: '',
    num12: '',
    num13: '',
    num14: '',
    num15: '',
    num16: '',
    num17: '',
    num18: '',
    num19: '',
    num20: '',
    num21: '',
    num22: '',
    num23: '',
    num24: '',
    num25: '',
    num26: '',
    num27: '',
    num28: '',
    num29: 0
  },
  {
    label: '收料欠数',
    num1: '',
    num2: '',
    num3: '',
    num4: '',
    num5: '',
    num6: '',
    num7: '',
    num8: '',
    num9: '',
    num10: '',
    num11: '',
    num12: '',
    num13: '',
    num14: '',
    num15: '',
    num16: '',
    num17: '',
    num18: '',
    num19: '',
    num20: '',
    num21: '',
    num22: '',
    num23: '',
    num24: '',
    num25: '',
    num26: '',
    num27: '',
    num28: '',
    num29: ''
  }
])

const tableHeaderList1 = ref<any>([
  {
    label: '发料合计',
    num1: '',
    num2: '',
    num3: '',
    num4: '',
    num5: '',
    num6: '',
    num7: '',
    num8: '',
    num9: '',
    num10: '',
    num11: '',
    num12: '',
    num13: '',
    num14: '',
    num15: '',
    num16: '',
    num17: '',
    num18: '',
    num19: '',
    num20: '',
    num21: '',
    num22: '',
    num23: '',
    num24: '',
    num25: '',
    num26: '',
    num27: '',
    num28: '',
    num29: ''
  },
  {
    label: '发料欠数',
    num1: '',
    num2: '',
    num3: '',
    num4: '',
    num5: '',
    num6: '',
    num7: '',
    num8: '',
    num9: '',
    num10: '',
    num11: '',
    num12: '',
    num13: '',
    num14: '',
    num15: '',
    num16: '',
    num17: '',
    num18: '',
    num19: '',
    num20: '',
    num21: '',
    num22: '',
    num23: '',
    num24: '',
    num25: '',
    num26: '',
    num27: '',
    num28: '',
    num29: ''
  },
  {
    label: '库存数量',
    num1: '',
    num2: '',
    num3: '',
    num4: '',
    num5: '',
    num6: '',
    num7: '',
    num8: '',
    num9: '',
    num10: '',
    num11: '',
    num12: '',
    num13: '',
    num14: '',
    num15: '',
    num16: '',
    num17: '',
    num18: '',
    num19: '',
    num20: '',
    num21: '',
    num22: '',
    num23: '',
    num24: '',
    num25: '',
    num26: '',
    num27: '',
    num28: '',
    num29: ''
  }
])

// 收留 发料明细查询
const MaterialsReceivedAndIssuedInquiriesMethdosTableDateList = ref('')

const TableDateListMaterials = ref<MaterialsReceivedAndIssuedInquiriesInterface>({
  inDtos: [],
  size: [],
  style: {},
  outDtos: [],
  sizeTotal: []
})

// 计算表格总和
const CalculatedSum = (ArrayList: any, index: string): string => {
  if (index === 'qty27' || index === 'qty28') {
    return '0'
  } else if (index === '') {
    return '0'
  } else {
    let num = ArrayList.reduce((item: number, _index: any) => {
      Number(_index)
      item += _index[index]
      return item
    }, 0)
    return num
  }
}

const numberList = ref(true)

const MaterialsReceivedAndIssuedInquiriesMethdos = async () => {
  const result = await MaterialsReceivedAndIssuedInquiries(MaterialsReceivedAndIssuedInquiriesMethdosTableDateList.value)
  if (result.data !== null) {
    TableDateListMaterials.value.inDtos = result.data.inDtos.map((item: any) => {
      item.deptNo = {
        selectValue: item.deptNo,
        options: []
      }
      item.disable = true
      item.change = true
      item.disableConfirm = true
      return item
    })
    TableDateListMaterials.value.size = result.data.size
    TableDateListMaterials.value.style = result.data.style
    TableDateListMaterials.value.outDtos = result.data.outDtos.map((item: any) => {
      item.deptNo = {
        selectValue: item.deptNo,
        options: []
      }
      item.disable = true
      item.change = true
      item.disableConfirm = true
      return item
    })

    formList1.value[1].inputValue = result.data.style.style
    formList1.value[2].inputValue = result.data.style.color
    formList1.value[3].inputValue = result.data.style.deliveryDate
    formList1.value[4].inputValue = result.data.style.qty

    const kesyArrayList = result.data.sizeTotal.map((item: { [s: string]: unknown } | ArrayLike<unknown>) => {
      return Object.values(item)
    })

    const keysArray = result.data.size.map((item: any) => {
      return Object.keys(item)
    })
    const keysArrayList = result.data.size.map((item: any) => {
      return Object.values(item)
    })

    if (result.data.inDtos.length > 0) {
      let list = 0
      for (let i = 1; i <= 28; i++) {
        tableHeaderList.value[0]['num' + i] = CalculatedSum(result.data.inDtos, `qty${i}`)
      }

      for (let i = 1; i <= 28; i++) {
        if (list < kesyArrayList.length) {
          tableHeaderList.value[1]['num' + i] = Number(kesyArrayList[list++]) - Number(tableHeaderList.value[0]['num' + i])
        } else {
          tableHeaderList.value[1]['num' + i] = 0 - Number(tableHeaderList.value[0]['num' + i])
        }
      }

      tableHeaderList.value[0].num29 = CalculatedSum(result.data.inDtos, 'ttlQty')

      const accumulatedArray = Object.values(tableHeaderList.value[1])
        .filter((_index: any) => _index !== '收料欠数' && !isNaN(Number(_index)))
        .reduce((acc: number[], curr: any, index: number) => {
          const currentValue = Number(curr)
          acc[index] = (acc[index - 1] || 0) + currentValue
          return acc
        }, [])

      tableHeaderList.value[1].num29 = accumulatedArray[accumulatedArray.length - 2]

      list = 0
    } else {
      for (let i = 1; i <= 29; i++) {
        if (keysArrayList[i - 1]) {
          tableHeaderList.value[0]['num' + i] = 0
          tableHeaderList.value[1]['num' + i] = keysArrayList[i - 1][0]
        }
      }
    }

    if (result.data.outDtos.length > 0) {
      let list = 0
      for (let i = 1; i <= 28; i++) {
        tableHeaderList1.value[0]['num' + i] = CalculatedSum(result.data.outDtos, `qty${i}`)
      }

      for (let i = 1; i <= 28; i++) {
        if (list < kesyArrayList.length) {
          tableHeaderList1.value[1]['num' + i] = Number(kesyArrayList[list++]) - Number(tableHeaderList1.value[0]['num' + i])
        } else {
          tableHeaderList1.value[1]['num' + i] = 0 - Number(tableHeaderList1.value[0]['num' + i])
        }
      }

      tableHeaderList1.value[0].num29 = CalculatedSum(result.data.outDtos, 'ttlQty')

      tableHeaderList1.value[1].num29 = Object.values(tableHeaderList1.value[1]).reduce((item: number, _index: any) => {
        if (_index !== '收料欠数' && !isNaN(Number(_index))) {
          item += Number(_index)
        }
        return item
      }, 0)

      list = 0
    } else {
      for (let i = 1; i <= 29; i++) {
        if (keysArrayList[i - 1]) {
          tableHeaderList1.value[0]['num' + i] = 0
          tableHeaderList1.value[1]['num' + i] = keysArrayList[i - 1][0]
        }
      }
    }

    let falg = 0
    let falg1 = 0

    let falg3 = 0
    let falg13 = 0

    tableHeader.value.forEach((item1: any, index1: number) => {
      if (index1 > 2 && index1 < tableHeader.value.length - 2) {
        item1.label = keysArray[falg++]
        item1.children[0].label = keysArrayList[falg1++]
      }
    })

    tableHeader1.value.forEach((item1: any, index1: number) => {
      if (index1 > 2 && index1 < tableHeader1.value.length - 2) {
        item1.label = keysArray[falg3++]
        item1.children[0].label = keysArrayList[falg13++]
      }
    })

    for (let i = 1; i <= 28; i++) {
      tableHeaderList1.value[2]['num' + i] = Math.abs(Number(tableHeaderList.value[0]['num' + i]) - Number(tableHeaderList1.value[0]['num' + i]))
    }

    tableHeaderList1.value[2].num29 = Math.abs(Number(tableHeaderList.value[0].num29) - Number(tableHeaderList1.value[0].num29))

    let sumList = 3
    let sumList1 = 3
    for (let i = 0; i < result.data.inDtos.length; i++) {
      for (let K = 1; K <= 26; K++) {
        if (result.data.inDtos[i]['qty' + K] !== null && result.data.inDtos[i]['qty' + K] !== undefined) {
          if (K <= keysArrayList.length) {
            if (tableHeaderList.value[1]['num' + K] === 0 && tableHeaderList.value[1]['num' + K] !== '') {
              if (tableHeader.value[sumList]) tableHeader.value[K + 2].children[0].disable = true
              sumList++
            }
          }
        }
      }
    }

    for (let i = 0; i < result.data.outDtos.length; i++) {
      for (let K = 1; K <= 26; K++) {
        if (result.data.outDtos[i]['qty' + K] !== null && result.data.outDtos[i]['qty' + K] !== undefined) {
          if (K <= keysArrayList.length) {
            if (tableHeaderList1.value[1]['num' + K] === 0 && tableHeaderList1.value[1]['num' + K] !== '') {
              if (tableHeader1.value[sumList]) tableHeader1.value[K + 2].children[0].disable = true
              sumList1++
            }
          }
        }
      }
    }

    sumList = 3
    sumList1 = 3
  } else {
    JMessage.error(result.message)
  }
}

const CalculatedSum1 = (obj: any, key: any) => {
  return Object.values(obj).reduce((total: any, value: any) => {
    if (typeof value !== 'string' && !isNaN(Number(value))) {
      total += Number(value)
    }
    return total
  }, 0)
}
// 表格数据

const tableHeader = ref([
  {
    label: '单位代码',
    prop: 'deptNo',
    type: 'select'
  },
  {
    label: '缴库单位',
    prop: 'deptName',
    change: true
  },
  {
    label: '收料日期',
    prop: 'slipDate',
    change: true
  },

  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty1'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty2'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty3'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty4'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty5'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty6'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty7'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty8'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty9'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty10'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty11'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty12'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty13'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty14'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty15'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty16'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty17'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty18'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty19'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty20'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty21'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty22'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty23'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty24'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty26'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty26'
      }
    ]
  },
  {
    label: '合计',
    prop: 'ttlQty',
    change: 'true'
  },
  {
    label: '备注',
    prop: 'remark'
  }
]) as any

const tableHeader1 = ref([
  {
    label: '单位代码',
    prop: 'deptNo',
    type: 'select'
  },
  {
    label: '缴库单位',
    prop: 'deptName',
    change: true
  },
  {
    label: '收料日期',
    prop: 'slipDate',
    change: true
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty1'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty2'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty3'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty4'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty5'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty6'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty7'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty8'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty9'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty10'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty11'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty12'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty13'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty14'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty15'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty16'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty17'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty18'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty19'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty20'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty21'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty22'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty23'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty24'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty26'
      }
    ]
  },
  {
    Multistage: true,
    label: '',
    children: [
      {
        label: '',
        prop: 'qty26'
      }
    ]
  },
  {
    label: '合计',
    prop: 'ttlQty',
    change: 'true'
  },
  {
    label: '备注',
    prop: 'remark'
  }
]) as any

const tableHeader2 = ref([
  {
    label: '',
    prop: 'label',
    width: '240'
  },
  {
    label: '',
    prop: 'num1'
  },
  {
    label: '',
    prop: 'num2'
  },
  {
    label: '',
    prop: 'num3'
  },
  {
    label: '',
    prop: 'num4'
  },
  {
    label: '',
    prop: 'num5'
  },
  {
    label: '',
    prop: 'num6'
  },
  {
    label: '',
    prop: 'num7'
  },
  {
    label: '',
    prop: 'num8'
  },
  {
    label: '',
    prop: 'num9'
  },
  {
    label: '',
    prop: 'num10'
  },
  {
    label: '',
    prop: 'num11'
  },
  {
    label: '',
    prop: 'num12'
  },
  {
    label: '',
    prop: 'num13'
  },
  {
    label: '',
    prop: 'num14'
  },
  {
    label: '',
    prop: 'num15'
  },
  {
    label: '',
    prop: 'num16'
  },
  {
    label: '',
    prop: 'num17'
  },
  {
    label: '',
    prop: 'num18'
  },
  {
    label: '',
    prop: 'num19'
  },
  {
    label: '',
    prop: 'num20'
  },
  {
    label: '',
    prop: 'num21'
  },
  {
    label: '',
    prop: 'num22'
  },
  {
    label: '',
    prop: 'num23'
  },
  {
    label: '',
    prop: 'num24'
  },
  {
    label: '',
    prop: 'num25'
  },
  {
    label: '',
    prop: 'num26'
  },
  {
    label: '',
    prop: 'num27'
  },
  {
    label: '',
    prop: 'num28'
  },

  {
    label: '',
    prop: 'num29'
  },
  {
    label: '',
    prop: 'num30'
  }
])

const tableHeader3 = ref([
  {
    label: '',
    prop: 'label',
    width: '240'
  },
  {
    label: '',
    prop: 'num1'
  },
  {
    label: '',
    prop: 'num2'
  },
  {
    label: '',
    prop: 'num3'
  },
  {
    label: '',
    prop: 'num4'
  },
  {
    label: '',
    prop: 'num5'
  },
  {
    label: '',
    prop: 'num6'
  },
  {
    label: '',
    prop: 'num7'
  },
  {
    label: '',
    prop: 'num8'
  },
  {
    label: '',
    prop: 'num9'
  },
  {
    label: '',
    prop: 'num10'
  },
  {
    label: '',
    prop: 'num11'
  },
  {
    label: '',
    prop: 'num12'
  },
  {
    label: '',
    prop: 'num13'
  },
  {
    label: '',
    prop: 'num14'
  },
  {
    label: '',
    prop: 'num15'
  },
  {
    label: '',
    prop: 'num16'
  },
  {
    label: '',
    prop: 'num17'
  },
  {
    label: '',
    prop: 'num18'
  },
  {
    label: '',
    prop: 'num19'
  },
  {
    label: '',
    prop: 'num20'
  },
  {
    label: '',
    prop: 'num21'
  },
  {
    label: '',
    prop: 'num22'
  },
  {
    label: '',
    prop: 'num23'
  },
  {
    label: '',
    prop: 'num24'
  },
  {
    label: '',
    prop: 'num25'
  },
  {
    label: '',
    prop: 'num26'
  },
  {
    label: '',
    prop: 'num27'
  },
  {
    label: '',
    prop: 'num28'
  },

  {
    label: '',
    prop: 'num29'
  },
  {
    label: '',
    prop: 'num30'
  }
])
</script>

<style lang="less" scoped>
h1 {
  font-size: 16px;
}
</style>
